import { Component, OnInit, Output, EventEmitter } from '@angular/core';
import { RemoveTableService } from '../../../public/serve/remove-table/remove-table.service';
import { HintsService } from '../../../public/serve/hints/hints.service';
import {Service} from '../../../server/server';

@Component({
  selector: 'internal-indexed-modal-reltheme-delete',
  templateUrl: './internal-indexed-delete.component.html',
  styleUrls: ['./internal-indexed-delete.component.css']
})
export class InternalIndexedDeleteComponents implements OnInit {

  ids : any;

  constructor(
    public server: Service,
    public removeTableService: RemoveTableService,
    private hintsService: HintsService
  ) { }

  ngOnInit() {
  }

  /**
   * 删除
   */
  _relthemeDelete(){
    this.removeTableService
    .confirmRemove('ids',this.server.baseUrl + 'Service/IdxProduct/deleteThemeWordsRelation','token','b25dbd7138cf48e09941087e6d9a2e93')
    .then(res => {
      if(res.result_code == '0000'){
          // this.server.internalindexedmodelreldeleteentEmit.emit(true);
          this.server.internalThemeWordsTablesRelEmit.emit(2);
      }

      this.hintsService.messages(res.message,res.result_code);
      return;
    })
    .catch(err => {
      this.hintsService.messages('error','error');
      return;
    });
  }

}
